package com.example.demo.Server.impl;

import com.example.demo.Server.UnsafeLoginServer;
import com.example.demo.entity.User;
import com.example.demo.mapper.Unsafe_Login_Mapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class UnsafeLoginServerImpl implements UnsafeLoginServer {

    @Autowired
    private Unsafe_Login_Mapper unsafeLoginMapper;
    
    @Override
    public List<User> unsafeLogin(String account, String password) {
        // 直接调用不安全的登录方法，存在SQL注入漏洞
        return unsafeLoginMapper.unsafeLogin(account, password);
    }
    
    @Override
    public int unsafeRegister(String account, String password) {
        // 直接调用不安全的注册方法，明文存储密码
        return unsafeLoginMapper.unsafeRegister(account, password);
    }
}